using UnityEngine;

public class PlayerMoveState : PlayerGroundState
{
    public PlayerMoveState(StateMachine stateMachine, string stateName, Player player) : base(stateMachine, stateName, player)
    {
    }

    

    public override void Enter()
    {
        base.Enter();
    }

    public override void Exit()
    {
        base.Exit();
    }

    public override void UpDate()
    {
        base.UpDate();
        if (player.moveInput.x==0||player.wallDetected)
        {
            stateMachine.ChangeState(player.playerIdleState);
        }
       
        player.SetVelocity(player.moveInput.x*player.moveSpeed,rb.linearVelocity.y);
        
    }
}
